<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2446：石头剪刀布</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">石头剪刀布</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">石头剪刀布</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                石头剪刀布                </h1>
                <p>时间限制：50s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="text-indent: 21pt"><span style="font-size: 12pt">A</span><span style="font-size: 12pt">和</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">进行石头剪刀布的游戏。</span></div>
<div style="text-indent: 21pt">&nbsp;<span style="font-size: 12pt">游戏按照每轮进行，每轮进行</span><span style="font-size: 12pt">n</span><span style="font-size: 12pt">局，如果</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">先比</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">多获胜</span><span style="font-size: 12pt">m1</span><span style="font-size: 12pt">轮，</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">赢得游戏；如果</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">先比</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">多获胜</span><span style="font-size: 12pt">m2</span><span style="font-size: 12pt">轮，</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">赢得游戏。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">对于每轮，进行</span><span style="font-size: 12pt">n</span><span style="font-size: 12pt">局游戏，已知每局</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">出石头、剪刀和布的概率，每局如果</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">赢</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">得一分，如果</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">赢</span><span style="font-size: 12pt">B</span><span style="font-size: 12pt">得一分，平局没人得分。最后得分多的人此轮获胜，得分相同此轮无人获胜。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">求</span><span style="font-size: 12pt">A</span><span style="font-size: 12pt">获胜的最大概率。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">多组数据。</span></div></p><hr/><h3>输入格式</h3><p><div>&nbsp;</div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">读入包含多组数据。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">对于每组数据：</span></div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">第一行包含三个数和</span><span style="font-size: 10.5pt">n</span><span style="font-size: 10.5pt">，</span><span style="font-size: 10.5pt">m1</span><span style="font-size: 10.5pt">，</span><span style="font-size: 10.5pt">m2</span><span style="font-size: 10.5pt">，如题目描述。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">接下来</span><span style="font-size: 10.5pt">n</span><span style="font-size: 10.5pt">行，每行</span><span style="font-size: 10.5pt">3</span><span style="font-size: 10.5pt">个数，分别表示</span><span style="font-size: 10.5pt">B</span><span style="font-size: 10.5pt">每局出<b>石头、布与剪刀</b>的百分率，保证三个数的和是</span><span style="font-size: 10.5pt">100.</span></div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">整个输入以0 0 0结束</span></div></p><hr/><h3>输出格式</h3><p><div style="text-indent: 21pt">&nbsp;</div>
<p>对于每组数据输出一行，表示获胜的百分率，保留3位小数。<br />
</p></p><hr/><h3>样例输入</h3><pre>2 1 1
50 50 0
0 0 100
1 2 1
20 20 60
5 3 1
32 47 21
25 37 38
34 40 26
49 20 31
25 60 15
5 3 1
41 13 46
13 27 60
50 24 26
14 32 54
25 56 19
10 3 1
21 33 46
31 25 44
24 32 44
39 39 22
21 39 40
30 25 45
49 21 30
30 24 46
20 33 47
43 28 29
10 3 1
30 20 50
44 23 33
31 28 41
28 48 24
35 26 39
29 34 37
47 31 22
32 43 25
25 29 46
30 42 28
362 91 3
34 35 31
33 33 34
33 33 34
33 34 33
33 32 35
33 35 32
34 33 33
31 35 34
32 35 33
35 34 31
33 34 33
34 31 35
33 34 33
33 35 32
32 34 34
34 34 32
32 35 33
32 34 34
32 35 33
34 32 34
35 32 33
34 35 31
35 34 31
34 31 35
35 34 31
33 34 33
32 35 33
33 33 34
32 33 35
34 32 34
35 34 31
35 33 32
34 33 33
34 34 32
34 32 34
33 32 35
32 33 35
35 34 31
32 35 33
35 34 31
35 33 32
35 31 34
33 34 33
32 33 35
35 32 33
32 34 34
32 35 33
32 34 34
33 35 32
34 34 32
33 34 33
35 34 31
32 34 34
34 32 34
35 33 32
33 34 33
34 35 31
33 33 34
35 32 33
35 34 31
33 33 34
31 35 34
33 33 34
34 35 31
33 34 33
32 35 33
32 34 34
33 33 34
31 35 34
34 31 35
34 34 32
35 32 33
33 32 35
34 32 34
35 34 31
35 31 34
34 33 33
34 32 34
31 35 34
35 32 33
34 33 33
32 35 33
33 35 32
33 35 32
33 34 33
32 33 35
32 33 35
31 34 35
33 33 34
35 31 34
31 35 34
34 31 35
35 31 34
32 34 34
34 35 31
35 33 32
34 31 35
34 31 35
34 31 35
34 33 33
33 33 34
34 31 35
33 34 33
35 33 32
32 35 33
32 33 35
31 34 35
33 35 32
34 32 34
34 34 32
33 32 35
35 34 31
34 35 31
32 33 35
32 35 33
34 31 35
35 32 33
34 31 35
34 35 31
31 34 35
35 33 32
31 35 34
34 35 31
34 31 35
35 33 32
34 33 33
34 31 35
34 31 35
34 34 32
33 34 33
34 32 34
34 35 31
34 34 32
32 35 33
35 32 33
35 32 33
35 31 34
35 32 33
33 33 34
31 35 34
32 33 35
31 34 35
34 33 33
34 32 34
32 33 35
33 34 33
34 33 33
35 32 33
32 33 35
32 34 34
32 35 33
33 35 32
35 33 32
34 31 35
32 33 35
33 35 32
31 35 34
34 31 35
33 34 33
34 35 31
33 32 35
34 32 34
33 35 32
34 35 31
31 35 34
33 33 34
32 34 34
34 33 33
35 33 32
34 34 32
33 33 34
32 34 34
33 32 35
34 31 35
34 32 34
33 32 35
32 34 34
35 32 33
34 31 35
34 32 34
33 32 35
34 32 34
35 31 34
34 33 33
31 35 34
33 35 32
32 34 34
31 34 35
33 34 33
34 34 32
34 32 34
35 31 34
32 33 35
34 31 35
34 34 32
32 34 34
32 34 34
32 33 35
31 34 35
32 34 34
33 35 32
33 33 34
35 33 32
31 35 34
35 32 33
31 34 35
32 34 34
33 32 35
35 32 33
35 31 34
34 32 34
32 34 34
31 34 35
34 35 31
34 34 32
35 31 34
31 35 34
33 34 33
34 34 32
33 33 34
35 33 32
34 33 33
34 33 33
34 33 33
33 35 32
35 34 31
33 33 34
34 35 31
31 35 34
32 35 33
32 33 35
35 34 31
33 33 34
35 32 33
32 33 35
34 31 35
35 34 31
34 32 34
31 34 35
35 34 31
35 31 34
32 33 35
33 33 34
32 33 35
34 31 35
31 35 34
35 32 33
34 35 31
33 32 35
34 32 34
33 32 35
34 33 33
33 33 34
31 35 34
35 34 31
35 32 33
34 31 35
32 35 33
34 34 32
35 33 32
33 35 32
34 31 35
33 34 33
34 33 33
34 35 31
34 32 34
32 35 33
32 33 35
35 32 33
34 32 34
33 33 34
33 33 34
35 31 34
34 35 31
34 35 31
35 31 34
34 32 34
31 34 35
33 33 34
32 34 34
34 32 34
32 35 33
33 32 35
33 32 35
33 33 34
35 33 32
31 34 35
35 31 34
33 34 33
31 34 35
34 35 31
31 34 35
32 35 33
33 35 32
34 35 31
32 35 33
34 32 34
32 33 35
32 34 34
35 33 32
32 35 33
33 32 35
35 34 31
34 35 31
33 33 34
33 32 35
32 33 35
33 34 33
35 32 33
31 35 34
31 34 35
32 35 33
33 34 33
31 35 34
33 34 33
34 33 33
33 33 34
32 34 34
32 35 33
33 35 32
34 31 35
34 35 31
31 34 35
35 33 32
35 34 31
31 34 35
34 31 35
32 35 33
34 31 35
33 35 32
34 35 31
34 33 33
34 34 32
34 33 33
32 33 35
32 34 34
35 33 32
35 32 33
34 34 32
32 35 33
34 33 33
33 35 32
33 35 32
33 35 32
35 31 34
34 33 33
33 33 34
34 31 35
34 35 31
34 31 35
32 34 34
35 33 32
35 32 33
35 34 31
34 32 34
32 34 34
35 32 33
33 34 33
32 33 35
35 31 34
34 35 31
33 35 32
0 0 0</pre><hr/><h3>样例输出</h3><pre>100.000%
69.231%
64.981%
80.864%
72.400%
69.287%
94.322%
</pre><hr/><h3>提示</h3><p><p>Data Limit<br />
对于40%的测试点，n&lt;=500 <br />
对于100%的测试点，n&lt;=1000,m1,m2&lt;=100。<br />
&nbsp;<br />
每个测试点中，数据组数都不超过10<br />
&nbsp;</p></p><hr/><h3>题目来源</h3><p>2011福建集训</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2446" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2446" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>